package com.axonactive;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.event.ActionEvent;
import javax.inject.Inject;

@ManagedBean(name="bookBean")
@RequestScoped
public class BookManagement {
	private String bookName;
	
	@Inject
	private BookService bookService;
	
	public List<Book> getBooks() {
		return bookService.getBooks();
	}
	
	public void saveBook() {
		Book book = new Book();
		book.setBookName(bookName);
		bookService.saveBook(book);
	}

	public String getBook() {
		return bookName;
	}

	public void setBook(String bookName) {
		this.bookName = bookName;
	}
}
